import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @Author DengJia
 * @Date 2021/8/9 14:47
 * @Description
 */

public class LambdaExpression {
    private final char value[];

    public LambdaExpression(char[] value) {
        this.value = value;
    }

    public static void main(String[] args) {
        List<String> list = Arrays.asList("java", "world","hello");
        Collections.sort(list);
        System.out.println("list = " + list);

        System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");

        List<String> list1 = Arrays.asList("tom", "jerry", "mark");
        Collections.sort(list1, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.compareTo(o2);
            }
        });
        System.out.println("list1 = " + list1);
    }
}
